<?php 
	require_once('dao/configuration.php'); 
	$_SESSION['curl'] = $curl; 
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<!-- page title -->
<title>Nu Skin Enterprises (Singapore) Pte Ltd Time Attendance Software</title>
<link rel="stylesheet" href="../css/core.css" type="text/css" />

</head>
<body>
<div id="wrapper">

	<div id="sitename" class="clear">
    	<!-- YOUR SITE NAME -->
		<h1><a href="#">Nu Skin Singapore</a></h1>
	</div>
	
	<div id="navbar">	
		<div class="clear">
			<ul class="sf-menu clear">
            	<!-- PAGE NAVIGATION -->
            	<?php if(isset($_SESSION['role'])) {?>
				<li class="<?php if(preg_match("/view.php/",$curl)) echo "selected"; ?>"><a href="view.html" ><span>View</span></a></li>
               	<li class="<?php if(preg_match("/download.php/",$curl)) echo "selected"; ?>"><a href="download.html"><span>Download</span></a></li>
				<?php } ?>
				<?php if(isset($_SESSION['role']) && $_SESSION['role'] == "Administrator") {?>
				<li class="<?php if(preg_match("/upload.php/",$curl)) echo "selected"; ?>"><a href="upload.php"><span>Upload</span></a></li>
				<?php }?>
				<?php if(isset($_SESSION['role']) && $_SESSION['role'] == "Supervisor") {?>
				<li class="<?php if(preg_match("/approve.php/",$curl)) echo "selected"; ?>"><a href="file.php"><span>Approve</span></a></li>
				<?php }?>
				
				
			</ul>
		</div>
	</div>
	<!--  
		<div id="header" class="clear">
			<div class="header-text">
				<h2><strong>Pellentesque</strong> habitant morbi tristique </h2>			
			</div>
		</div>
		<div class="header-bottom"></div>
	-->
	<div id="body-wrapper">
	
    	<!-- BREADCRUMB NAVIGATION -->
		<div class="bcnav">
			<div class="bcnav-left">
					<div class="bcnav-right clear">
				<!-- 	<h3>you are here: <u>Collection</u></h3> -->
					<div class="login-box">
					<?php if(isset($_SESSION['name'])) { ?>
							 	Welcome, <strong> <?php echo $_SESSION['name'] ?></strong>  (<a href="taController.php?request=logout&return=<?php echo $domain?>/index.php">Logout</a>)
					
					<?php } 
					       else { ?>
								<form id="login_form" method="post" action="taController.php?request=login&return=<?php echo $domain; ?>/index.php" enctype="multipart/form-data">
									
									User Id
									<input type="text" name="userid" />
									Password
									<input type="password" name="password" />
									<input class="loginbutton" value="Login" type="submit"/></p>
									<?php if($_GET['result'] == 'fail') { ?><div class="error">Invalid login details. Please try again.</div><?php } ?>
								</form>
								 
						<?php }?>
					</div>
					</div>
			</div>		
		</div>